#! /usr/bin/env python
# coding=utf-8
import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))


class Config:
    # Development env open this, when error occur display the full process track, Production disable it
    DEBUG = True

    LOG_DIR = os.path.join(BASE_DIR, 'logs')

    SECRET_KEY = os.environ.get('SECRET_KEY') or '*wppzeu78ce!^7$s0!$+)_rs$^r7x*xp#syye3)v4&fqatqx96'

    # mongodb setting like:
    MONGO_ENGINE = 'mongo'
    MONGO_HOST = '127.0.0.1'
    MONGO_PORT = 27017
    MONGO_USER = ''
    DB_PASSWORD = ''
    MONGO_DBS = 'futurestar'

    # When tornado start it will bind this port
    TCP_BIND_HOST = '0.0.0.0'
    TCP_LISTEN_PORT = 8006

    # Use Redis as broker for celery and web socket
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379
    REDIS_PASSWORD = ''

    def __init__(self):
        pass

    def __getattr__(self, item):
        return None


class DevelopmentConfig(Config):
    pass


class TestConfig(Config):
    pass


class ProductionConfig(Config):
    pass


# Default using Config settings, you can write if/else for different env
config = DevelopmentConfig()